<template>
	<view>
		<view class="list_body">
			<view class="item_grid">
				<view class="grid-item-3 newlist" @tap="clickto(item.url)" :class="closeindex == index?'animations':''" v-for="(item,index) in funclist"
				 :key="index" v-if="item.isShow">
					<view><img :src="item.imgurl" alt="" class="grid_image"></view>
					<view>{{item.name}}</view>
					<view class="close" @tap.stop="close(index)" v-if="isclose">
						<img src="/static/image/close.png" alt="">
					</view>
				</view>
				<view class="grid-item-3" style="padding: 12px;display: flex;flex-direction: column;align-items: center;justify-content: center;" @tap="showModel()">
					<img src="/static/image/addfunc.png" style="height: 112upx;width: 112upx;" alt="">
					<view>添加</view>
				</view>
				<!-- <view @tap="update()" class="setheadertitle">{{updatetitle}}</view> -->
				<view class="grid-item-3" style="padding: 12px;display: flex;flex-direction: column;align-items: center;justify-content: center;" @tap="update()">
					<img src="/static/image/compile.png" style="height: 112upx;width: 112upx;" alt="">
					<view>编辑</view>
				</view>
			</view>
		</view>
		<view class="cu-modal " :class="modalName=='Modal'?'show':''">
			<view class="cu-dialog" style="height: 90%;">
				<view class="cu-bar bg-white justify-end">
					<view class="content">设置常用功能</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-red"></text>
					</view>
				</view>
				<view class="padding-xl" style="padding: 6px;">
					<view class="tab_header">
						<view v-for="(item, index) in table" class="table_title" :class="[{'colors':current == index}]" :key="index" @tap="tabcheckd(index)">
							<view>{{item.name}}</view>
						</view>
					</view>
				</view>
				<view class="tab_page" v-if="current == 0">
					<view class="list_header">开单列表</view>
					<view class="item_list" @tap="checkd('startBill',index)" v-for="(item,index) in AllList.startBill" :key="index"
					 v-if="item.isShow">
						<!-- <view class="list_image"><img :src="item.status?'/static/image/noradius.png':''" alt=""></view> -->
						<checkbox  :checked="item.status" />
						<view class="font">{{item.name}}</view>
					</view>
					<view class="list_header">验单列表</view>
					<view class="item_list" @tap="checkd('checkBill',index)" v-for="(item,index) in AllList.checkBill" :key="index+110"
					 v-if="item.isShow">
						<checkbox  :checked="item.status" />
						<view class="font">{{item.name}}</view>
					</view>
				</view>
				<view class="tab_page" v-if="current == 1">
					<view class="list_header">信息档案</view>
					<view class="item_list" @tap="checkd('info',index)" v-for="(item,index) in AllList.info" :key="index+1" v-if="item.isShow">
						<checkbox  :checked="item.status" />
						<view class="font">{{item.name}}</view>
					</view>
					<view class="list_header">报表查询</view>
					<view class="item_list" @tap="checkd('formselect',index)" v-for="(item,index) in AllList.formselect" :key="index+11"
					 v-if="item.isShow">
						<checkbox  :checked="item.status" />
						<view class="font">{{item.name}}</view>
					</view>

				</view>
				<view class="tab_page" v-if="current == 2">

					<view class="item_list" @tap="checkd('other',index)" v-for="(item,index) in AllList.other" :key="index+2">
						<checkbox  :checked="item.status" />
						<view class="font">{{item.name}}</view>
					</view>
				</view>
				<view class="tab_page" v-if="current == 3">

					<view class="item_list" @tap="checkd('system',index)" v-for="(item,index) in AllList.system" :key="index+3">
						<checkbox  :checked="item.status" />
						<view class="font">{{item.name}}</view>
					</view>

				</view>
				<view class="set_btn">
					<view class="btn_close" @tap="hideModal">取消</view>
					<view class="btn_confirm" @tap="confirm">确认</view>
				</view>
			</view>
		</view>
		<tab-bar :current="2"></tab-bar>
		<!-- <view @tap="update()" class="setheadertitle">{{updatetitle}}</view> -->
	</view>
</template>

<script>
	import tabBar from "@/components/tabBar.vue"
	export default {
		components: {
			tabBar,
		},
		data() {
			return {
				funclist: [
					// {name:'业务草稿',imgurl:'/static/image/caigou.png'},

				],
				closeindex: -1,
				modalName: null,
				isclose: false,
				updateimage: '/static/image/compile.png',
				updatetitle: '编辑',
				current: 0,
				table: [{
						name: '单据列表',
						url: "../static/image/divide.png",
						active: "../static/image/activedivide.png"
					},
					{
						name: '信息档案',
						url: "../static/image/sub.png",
						active: "../static/image/activesub.png"
					},
					{
						name: '其他功能',
						url: "../static/image/lose.png",
						active: "../static/image/activelose.png"
					},
					{
						name: '系统设置',
						url: "../static/image/lose.png",
						active: "../static/image/activelose.png"
					},

				],
				AllList: {
					startBill: [ //开单列表
						{
							name: '采购订单',
							status: false,
							url: '/pages/add-order/add-cgorder?BillName=采购订单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '采购入库单',
							status: false,
							url: '/pages/add-order-rk-ck/add-cgorder-rk-ck?BillName=采购入库单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '采购退货单',
							status: false,
							url: '/pages/add-order-rk-ck/add-cgorder-rk-ck?BillName=采购退货单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '销售订单',
							status: false,
							url: '/pages/add-order/add-cgorder?BillName=销售订单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '销售出库单',
							status: false,
							url: '/pages/add-order-rk-ck/add-cgorder-rk-ck?BillName=销售出库单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '销售退货单',
							status: false,
							url: '/pages/add-order-rk-ck/add-cgorder-rk-ck?BillName=销售退货单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '调拨单',
							status: false,
							url: '/pages/add-order-allot/add-cgorder-allot?BillName=调拨单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '其他入库单',
							status: false,
							url: '/pages/add-order-rk-ck/add-cgorder-rk-ck?BillName=其他入库单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '其他出库单',
							status: false,
							url: '/pages/add-order-rk-ck/add-cgorder-rk-ck?BillName=其他出库单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '配送申请单',
							status: false,
							url: '/pages/add-order-delivery/add-order-delivery?BillName=配送申请单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '配送出库单',
							status: false,
							url: '/pages/add-order-delivery/add-order-delivery?BillName=配送出库单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '配送退回单',
							status: false,
							url: '/pages/add-order-delivery/add-order-delivery?BillName=配送退回单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '促销单',
							status: false,
							url: '/pages/add-order/add-cgorder?BillName=促销单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '收款单',
							status: false,
							url: '/pages/add-order-gathering/add-order-gathering?BillName=收款单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '付款单',
							status: false,
							url: '/pages/add-order-gathering/add-order-gathering?BillName=付款单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '会员充值',
							status: false,
							url: '/pages/add-order-gathering/add-order-gathering?BillName=会员充值',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '快速盘点单',
							status: false,
							url: '/pages/add-order-Inventory/add-order-Inventory?BillName=盘点单',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						// {name:'POS单',status:false,url:''},
					],
					checkBill: [ //验单列表
						{
							name: '<验>采购入库单',
							status: false,
							url: '/pages/validation/validation',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '<验>采购退货单',
							status: false,
							url: '/pages/Purchasereturn/Purchasereturn',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '<验>销售出库单',
							status: false,
							url: '/pages/salesout/salesout',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '<验>销售退货单',
							status: false,
							url: '/pages/salesreturn/salesreturn',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '<验>配送出库单',
							status: false,
							url: '/pages/deliveryout/deliveryout',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '<验>配送退回单',
							status: false,
							url: '/pages/deliveryreturn/deliveryreturn',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
					],
					info: [ //信息档案
						{
							name: '商品类型',
							status: false,
							url: '/pages/InfoListpage/goodfl',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '商品单位',
							status: false,
							url: '/pages/info-goodUnit/info-goodUnit',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '商品档案',
							status: false,
							url: '/pages/info-GoodsMessage/info-GoodsMessage',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '机构档案',
							status: false,
							url: '/pages/info-organ/info-organ02',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '仓库档案',
							status: false,
							url: '/pages/info-storehouse/info-storehouse',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '部门档案',
							status: false,
							url: '/pages/info-department/info-department',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '员工档案',
							status: false,
							url: '/pages/info-staff/info-staff',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '往来单位',
							status: false,
							url: '/pages/info-comeUnit/info-comeUnit',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '会员档案',
							status: false,
							url: '/pages/info-vipMessage/info-vipMessage',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '银行账号',
							status: false,
							url: '/pages/info-BankMessage/info-BankMessage',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
					],
					formselect: [ //报表查询
						{
							name: '业务草稿',
							status: false,
							url: '/pages/BillProcess/BillProcess?type=0',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '采购查询(商品汇总)',
							status: false,
							url: '/pages/order/order?type=0',
							imgurl: '/static/image/caigou.png',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '销售查询(商品汇总)',
							status: false,
							url: '/pages/order/order?type=1',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '供应商采购汇总',
							status: false,
							url: '/pages/curstomOrder/curstomOrder?type=0',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '客户销售汇总',
							status: false,
							url: '/pages/curstomOrder/curstomOrder?type=1',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						
						{
							name: '经营历程',
							status: false,
							url: '/pages/BillProcess/BillProcess?type=1',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '库存状态表',
							status: false,
							url: '/pages/StatusProcess/StatusProcess',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '商品销售流水(POS)',
							status: false,
							url: '/pages/saleWater/saleWater',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '收银流水(POS)',
							status: false,
							url: '/pages/giveMoneyWater/giveMoneyWater',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '应付应收',
							status: false,
							url: '/pages/ysyf/ysyf',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '销售毛利汇总',
							status: false,
							url: '/pages/SaleProfit/saleProfit',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '业务员采购统计',
							status: false,
							url: '/pages/accountOrder/accountOrder?type=0',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						{
							name: '业务员销售统计',
							status: false,
							url: '/pages/accountOrder/accountOrder?type=1',
							imgurl: '/static/image/caigou.png',
							isShow: true
						},
						// {name:'出入库明细状况报表',status:false,url:''},
						// {name:'快速盘点汇总表',status:false,url:''},
						// {name:'销售毛利综合表',status:false,url:''},
					],
					other: [ //其他功能
						{
							name: '版本差异',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '离线单据上传',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '状态切换',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '商品查询',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '扫描回车设置',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
					],
					system: [ //系统设置
						{
							name: '打印设置',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '小票设置',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '蓝牙配对',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '权限设定',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						// {
						// 	name: '单据编辑',
						// 	status: false,
						// 	url: '',
						// 	imgurl: '/static/image/caigou.png'
						// },
						// {
						// 	name: '下载离线数据',
						// 	status: false,
						// 	url: '',
						// 	imgurl: '/static/image/caigou.png'
						// },
						// {
						// 	name: 'FTP下载',
						// 	status: false,
						// 	url: '',
						// 	imgurl: '/static/image/caigou.png'
						// },
						{
							name: '更新权限',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '默认设置',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '条码规则',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '版本更新',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '开启动画',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '使用设置',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '签到定位',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '错误数据上传厂家',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '上传日志',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
						{
							name: '关于版本',
							status: false,
							url: '',
							imgurl: '/static/image/caigou.png'
						},
					]


				}
			}
		},
		created() {
			var settinginfo = uni.getStorageSync("ROOT_SETTING", "");
			if (settinginfo != "" && typeof settinginfo != 'undefined') {
				var existing = JSON.parse(settinginfo)
				var list = []
				var data = this.AllList
				var checklist = []
				Object.keys(data).forEach(function(key, value) {
					for (var i in data[key]) {
						for (var j in existing) {
							if (data[key][i]["name"] == existing[j]) {
								data[key][i].status = true
								checklist.push(data[key][i]);
							}
						}
					}
				})
				this.funclist = checklist
				this.AllList = data
			}

		},
		onLoad(options) {
			// uni.getStorageSync("PDA_Price_Module", ""); //存储单价权限
			// uni.getStorageSync("PDA_Price_Module2", JSON.stringify(PDA_Price_Module2)); //获取商品信息显示权限
			// uni.getStorageSync("PDA_Store_Module", JSON.stringify(PDA_Store_Module)); //获取仓库权限
			let PDA_Module_Android = uni.getStorageSync("PDA_Module_Android", "[]"); //获取单据权限
			let PDA_Module_Options = uni.getStorageSync("PDA_Module_Options", "[]"); //获取功能权限
			PDA_Module_Android = JSON.parse(PDA_Module_Android);
			PDA_Module_Options = JSON.parse(PDA_Module_Options);
			console.log(PDA_Module_Android);
			PDA_Module_Android.forEach((item, index) => {
				if (item.ModuleName == '采购订单') {
					if(item.IsBill == ""){
						this.AllList.startBill[0].isShow = false;
					}
					
				} else if (item.ModuleName == '采购入库单') {
					
                    if(item.IsBill == ""){
                    	this.AllList.startBill[1].isShow = false;
                    }
					if (item.IsCheck == "") {
						this.AllList.checkBill[0].isShow = false;
					}
				} else if (item.ModuleName == '采购退货单') {
					if(item.IsBill == ""){
						this.AllList.startBill[2].isShow = false;
					}
					if (item.IsCheck == "") {
						this.AllList.checkBill[1].isShow = false;
					}
				} else if (item.ModuleName == '销售订单') {
					// this.AllList.startBill[3].isShow = false;
					if(item.IsBill == ""){
						this.AllList.startBill[3].isShow = false;
					}
				} else if (item.ModuleName == '销售出库单') {
					if(item.IsBill == ""){
						this.AllList.startBill[4].isShow = false;
					}
					if (item.IsCheck == "") {
						this.AllList.checkBill[2].isShow = false;
					}
				} else if (item.ModuleName == '销售退货单') {
					if(item.IsBill == ""){
						this.AllList.startBill[5].isShow = false;
					}
					if (item.IsCheck == "") {
						this.AllList.checkBill[3].isShow = false;
					}
				} else if (item.ModuleName == '调拨单') {
					if(item.IsBill == ""){
						this.AllList.startBill[6].isShow = false;
					}
				} else if (item.ModuleName == '其他入库单') {
					if(item.IsBill == ""){
						this.AllList.startBill[7].isShow = false;
					}
				} else if (item.ModuleName == '其他出库单') {
					if(item.IsBill == ""){
						this.AllList.startBill[8].isShow = false;
					}
				} else if (item.ModuleName == '配送申请单') {
					if(item.IsBill == ""){
						this.AllList.startBill[9].isShow = false;
					}
				} else if (item.ModuleName == '配送出库单') {
					if(item.IsBill == ""){
						this.AllList.startBill[10].isShow = false;
					}
					if (item.IsCheck == "") {
						this.AllList.checkBill[4].isShow = false;
					}
				} else if (item.ModuleName == '配送退回单') {
					if(item.IsBill == ""){
						this.AllList.startBill[11].isShow = false;
					}
					if (item.IsCheck == "") {
						this.AllList.checkBill[5].isShow = false;
					}
				} else if (item.ModuleName == '促销单') {
					if(item.IsBill == ""){
						this.AllList.startBill[12].isShow = false;
					}
				} else if (item.ModuleName == '收款单') {
					if(item.IsBill == ""){
						this.AllList.startBill[13].isShow = false;
					}
				} else if (item.ModuleName == '付款单') {
					if(item.IsBill == ""){
						this.AllList.startBill[14].isShow = false;
					}
				} else if (item.ModuleName == '会员充值') {
					if(item.IsBill == ""){
						this.AllList.startBill[15].isShow = false;
					}
				} else if (item.ModuleName == '快速盘点单') {
					if(item.IsBill == ""){
						this.AllList.startBill[16].isShow = false;
					}
				}
			});
			PDA_Module_Options.forEach((item,index)=>{
				 if(item.ModuleName == '商品类型'){
					 if(item.IsBill == ""){
					 	this.AllList.info[0].isShow = false;
					 }
					 
				 }else if(item.ModuleName == '商品单位'){
					if(item.IsBill == ""){
						this.AllList.info[1].isShow = false;
					}
				 }else if(item.ModuleName == '商品档案'){
					 if(item.IsBill == ""){
					 	this.AllList.info[2].isShow = false;
					 }
				 }else if(item.ModuleName == '机构档案'){
					if(item.IsBill == ""){
						this.AllList.info[3].isShow = false;
					}
				 }else if(item.ModuleName == '仓库档案'){
					 if(item.IsBill == ""){
					 	this.AllList.info[4].isShow = false;
					 }
				 }else if(item.ModuleName == '部门档案'){
					 if(item.IsBill == ""){
					 	this.AllList.info[5].isShow = false;
					 }
				 }else if(item.ModuleName == '员工档案'){
					 if(item.IsBill == ""){
					 	this.AllList.info[6].isShow = false;
					 }
				 }else if(item.ModuleName == '往来单位'){
					if(item.IsBill == ""){
						this.AllList.info[7].isShow = false;
					}
				 }else if(item.ModuleName == '会员档案'){
					if(item.IsBill == ""){
						this.AllList.info[8].isShow = false;
					}
				 }else if(item.ModuleName == '银行帐号'){
					 console.log("银行账户",item.IsBill)
					if(item.IsBill == ""){
						this.AllList.info[9].isShow = false;
					}
				 }else if(item.ModuleName == '业务草稿'){
					if(item.IsBill == ""){
						this.AllList.formselect[0].isShow = false;
					}
				 }else if(item.ModuleName == '采购查询(商品汇总)'){
					if(item.IsBill == ""){
						this.AllList.formselect[1].isShow = false;
					}
				 }else if(item.ModuleName == '销售查询(商品汇总)'){
					if(item.IsBill == ""){
						this.AllList.formselect[2].isShow = false;
					}
				 }else if(item.ModuleName == '供应商采购汇总'){
					if(item.IsBill == ""){
						this.AllList.formselect[3].isShow = false;
					}
				 }else if(item.ModuleName == '客户销售汇总'){
					if(item.IsBill == ""){
						this.AllList.formselect[4].isShow = false;
					}
				 }else if(item.ModuleName == '经营历程'){
					if(item.IsBill == ""){
						this.AllList.formselect[5].isShow = false;
					}
				 }else if(item.ModuleName == '库存状态表'){
					if(item.IsBill == ""){
						this.AllList.formselect[6].isShow = false;
					}
				 }else if(item.ModuleName == '商品销售流水(POS)'){
					if(item.IsBill == ""){
						this.AllList.formselect[7].isShow = false;
					}
				 }else if(item.ModuleName == '收银流水(POS)'){
					if(item.IsBill == ""){
						this.AllList.formselect[8].isShow = false;
					}
				 }else if(item.ModuleName == '应付应收'){
					if(item.IsBill == ""){
						this.AllList.formselect[9].isShow = false;
					}
				 }else if(item.ModuleName == '销售毛利汇总'){
					if(item.IsBill == ""){
						this.AllList.formselect[10].isShow = false;
					}
				 }else if(item.ModuleName == '业务员采购统计'){
					if(item.IsBill == ""){
						this.AllList.formselect[11].isShow = false;
					}
				 }else if(item.ModuleName == '业务员销售统计'){
					if(item.IsBill == ""){
						this.AllList.formselect[12].isShow = false;
					}
				 }else if(item.ModuleName == '业务员销售统计'){
					if(item.IsBill == ""){
						this.AllList.formselect[12].isShow = false;
					}
				 } else if(item.ModuleName == '版本差异'){
					if(item.IsBill == ""){
						this.AllList.other[0].isShow = false;
					}
				 }  else if(item.ModuleName == '离线单据上传'){
					if(item.IsBill == ""){
						this.AllList.other[1].isShow = false;
					}
				 }  else if(item.ModuleName == '状态切换'){
					if(item.IsBill == ""){
						this.AllList.other[2].isShow = false;
					}
				 }  else if(item.ModuleName == '商品查询'){
					if(item.IsBill == ""){
						this.AllList.other[3].isShow = false;
					}
				 }  else if(item.ModuleName == '扫描回车设置'){
					if(item.IsBill == ""){
						this.AllList.other[4].isShow = false;
					}
				 }  else if(item.ModuleName == '打印设置'){
					if(item.IsBill == ""){
						this.AllList.system[1].isShow = false;
					}
				 }  else if(item.ModuleName == '小票设置'){
					if(item.IsBill == ""){
						this.AllList.system[2].isShow = false;
					}
				 }  else if(item.ModuleName == '蓝牙配对'){
					if(item.IsBill == ""){
						this.AllList.system[3].isShow = false;
					}
				 }  else if(item.ModuleName == '权限设定'){
					if(item.IsBill == ""){
						this.AllList.system[4].isShow = false;
					}
				 } else if(item.ModuleName == '更新权限'){
					if(item.IsBill == ""){
						this.AllList.system[5].isShow = false;
					}
				 }  else if(item.ModuleName == '默认设置'){
					if(item.IsBill == ""){
						this.AllList.system[6].isShow = false;
					}
				 }  else if(item.ModuleName == '条码规则'){
					if(item.IsBill == ""){
						this.AllList.system[7].isShow = false;
					}
				 } else if(item.ModuleName == '版本更新'){
					if(item.IsBill == ""){
						this.AllList.system[8].isShow = false;
					}
				 } else if(item.ModuleName == '开启动画'){
					if(item.IsBill == ""){
						this.AllList.system[9].isShow = false;
					}
				 }  else if(item.ModuleName == '使用设置'){
					if(item.IsBill == ""){
						this.AllList.system[10].isShow = false;
					}
				 }  else if(item.ModuleName == '签到定位'){
					if(item.IsBill == ""){
						this.AllList.system[11].isShow = false;
					}
				 } else if(item.ModuleName == '错误数据上传厂家'){
					if(item.IsBill == ""){
						this.AllList.system[12].isShow = false;
					}
				 } else if(item.ModuleName == '上传日志'){
					if(item.IsBill == ""){
						this.AllList.system[13].isShow = false;
					}
				 } else if(item.ModuleName == '关于版本'){
					if(item.IsBill == ""){
						this.AllList.system[14].isShow = false;
					}
				 } 
			});
		},
		methods: {
			close: function(index) {
				this.closeindex = index
				var that = this
				setTimeout(function() {
					var del = that.funclist;
					del.splice(index, 1);
					that.funclist = del;
					that.closeindex = -1;
					// console.log(that.funclist)
					// console.log(this.funclist)
					var list = []
					for (var i in del) {
						list.push(del[i]["name"])
					}
					uni.setStorageSync("ROOT_SETTING", JSON.stringify(list))
				}, 290)
				var name = this.funclist[index].name
				var status = this.funclist[index].status
				var url = this.funclist[index].url
				var data = this.AllList
				Object.keys(data).forEach(function(key, value) {
					for (var i in data[key]) {
						if (data[key][i]['name'] == name && data[key][i]['status'] == status && data[key][i]['url'] == url) {
							data[key][i]['status'] = false
						}
					}
				})
				this.AllList = data
				// var settinginfo = uni.getStorageSync("ROOT_SETTING","");
				// if(settinginfo != ""&& typeof settinginfo !=  'undefined'){
				// 	// this.funclist = JSON.parse(settinginfo)
				// 	console.log('删除的数组')
				// 	console.log(settinginfo)
				// 	console.log(this.funclist)
				// }
				// uni.setStorageSync("ROOT_SETTING",JSON.stringify(this.funclist))
				// this.AllList[name][index].status = !this.AllList[name][index].status
			},
			showModel: function() {
				this.modalName = 'Modal'
			},
			clickto: function(url) {
				console.log(url)
				uni.navigateTo({
					url: url + ""
				});
			},
			update: function() {
				if (this.updatetitle == '编辑') {
					this.updatetitle = '完成'
					this.updateimage = '/static/image/cccc.png',
						this.isclose = true

				} else {
					this.updatetitle = '编辑'
					this.updateimage = '/static/image/compile.png'
					this.isclose = false
				}
			},
			hideModal() {
				this.modalName = null
			},
			tabcheckd: function(index) {
				this.current = index
			},
			checkd: function(name, index) {
				// console.log(name,index)
				this.AllList[name][index].status = !this.AllList[name][index].status
			},
			confirm: function() {
				var list = []
				var data = this.AllList
				var namelist = []
				Object.keys(data).forEach(function(key, value) {
					for (var i in data[key]) {
						// console.log(data[key][i])
						if (data[key][i]['status'] == true) {
							list.push(data[key][i])
							namelist.push(data[key][i]["name"])
						}
					}
				})
				console.log(namelist)
				this.funclist = list
				uni.setStorageSync("ROOT_SETTING", JSON.stringify(namelist))
				this.modalName = null
			}
		}
	}
</script>

<style>
	page {
		background-color: #EDF2F9;
	}

	.list_body {
		margin: 5px;
		/* display: g; */
	}

	.item_grid {
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
		-webkit-flex-wrap: wrap;
		flex-wrap: wrap;
		/* background: #FFF; */
		border-radius: 4px;
		box-sizing: border-box;
		border-top: 0.5px solid rgba(172, 172, 172, 0.2);
	}

	.grid-item-3 {
		box-sizing: border-box;
		width: calc(90% / 3);
		border-bottom: 0.5px solid rgba(172, 172, 172, 0.2);
		border-right: 0.5px solid rgba(172, 172, 172, 0.2);
		text-align: center;
		padding: 21px 0;
		position: relative;
		margin: 1.65%;
		border-radius: 3px;
		background-color: #fff;
		box-shadow: 0 7px 14px 0 rgba(59, 65, 94, 0.1), 0 3px 6px 0 rgba(0, 0, 0, 0.07);
	}

	.close {
		width: 16px;
		height: 16px;
		/* background-color: #1296db; */
		position: absolute;
		top: -3px;
		right: -3px;
	}

	/* transform: scale(0.5, 0.5); */
	.close>img {
		width: 100%;
		height: 100%;
	}

	.animations {
		animation: scale 0.3s;
	}

	@keyframes scale {
		from {
			transform: scale(1, 1);
		}

		to {
			transform: scale(0, 0);
		}
	}

	.tab_header {
		height: 100upx;
		background-color: #fff;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-around;
		color: #000;
		// border-bottom: 1px solid #2196F3;
		font-size: 12px;
		box-shadow: 0px 1px 5px #d8d4d4;
		font-size: 14px;
		/* // -moz-box-shadow:0px 10px 5px #333333; -webkit-box-shadow:0px 10px 5px #333333; box-shadow:0px 10px 5px #333333; */
	}

	.table_title {
		// border-bottom: 2px solid #fff;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		color: #8a8a8a;
	}

	.table_title>img {
		width: 23px;
		height: 23px;
		padding-right: 5px;
	}

	.colors {
		color: #0081FF;
		/* // border-bottom: 2px solid #fff; */
	}

	.list_header {
		height: 30px;
		background-color: #0081FF;
		color: #fff;
		text-align: left;
		line-height: 30px;
		padding-left: 10px;
		margin:  0 5px;
		border-radius: 3px;
	}

	.list_image {
		width: 20px;
		height: 20px;
		border: 1px solid #b7b3b3;
		border-radius: 3px;
	}

	.list_image>img {
		width: 100%;
		height: 100%;
	}

	.item_list {
		display: flex;
		height: 80upx;
		/* background-color: #1976D2; */
		background-color: #fff;
		color: #000;
		margin: 5px;
		justify-content: end;
		align-items: center;
		border-radius: 3px;
		padding-left: 10px;
		box-shadow: 0 7px 14px 0 rgba(59, 65, 94, 0.1), 0 3px 6px 0 rgba(0, 0, 0, 0.07);
		/* border-bottom: 1px solid red; */

	}

	.font {
		padding-left: 10px;
	}

	.set_btn {
		height: 40px;
		width: 100%;
		/* background-color: red; */
		position: absolute;
		bottom: 0;
		left: 0;
		/* border-top: 2px solid red; */
		background-color: #fff;
		display: flex;
		align-items: center;
		box-shadow: 0px -5px 5px #e6e6e6;
		z-index: 9999;
	}

	.btn_close {
		flex: 1;
		/* border-right: 2px solid red; */
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #e54d42;
		color: #fff;
	}

	.btn_confirm {
		flex: 1;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #0081FF;
		color:#fff
	}

	.setheadertitle {
		width: 65px;
		height: 44px;
		color: #fff;
		display: flex;
		justify-content: center;
		align-items: center;
		position: fixed;
		right: 0;
		top: 0;
		font-size: 14px;
		/* background-color: red; */
		z-index: 999;
	}
	.tab_page{
		background-color: #EDF2F9;
		height: calc(90% - 60px);
		overflow: scroll;
		padding-bottom:90upx
	}
	.uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before{
		font: 28px;
		color: red !important;
	}
	.newlist{
		padding: 14px 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.grid_image{
		width: 96upx;
		height: 96upx;
	}
</style>
